-
Notifications
You must be signed in to change notification settings - Fork 781
iOS PWA improvments #89
base: main
Are you sure you want to change the base?
Conversation
Explains why PiP and Fullscreen are disabled. *Needs translations
*Primarily adds a Widescreen button to replace a native iOS fullscreen feature. (Due to it being disabled now) Also available by holding shift and pressing the fullscreen button on desktop.
Fucking apple |
2ef762b
to
1e4ec0c
Compare
This reverts commit 1a36d96. Reverted due to it disabling pull to refresh on mobile :(
Revert "Disable scrolling in player" due to disabling mobile pull to refresh feature. |
|
||
function IosPwaLimitations() { | ||
const showAlert = () => { | ||
alert( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't be using this
please do smth better like a modal that also is themed properly
import { VideoPlayerButton } from "@/components/player/internals/Button"; | ||
|
||
export function Widescreen() { | ||
// Add widescreen status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Widescreen isn't a replacement/alternative to fullscreen
This also seems very unfinished
so we look into how add widescreen properly later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now please remove this
@@ -20,6 +22,26 @@ export function PlayerPart(props: PlayerPartProps) { | |||
const { isMobile } = useIsMobile(); | |||
const isLoading = usePlayerStore((s) => s.mediaPlaying.isLoading); | |||
|
|||
// Detect if running as a PWA on iOS | |||
const isIOSPWA = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just make this a separate hook in /hooks
window.matchMedia("(display-mode: standalone)").matches; | ||
|
||
// Detect if Shift key is being held | ||
const [isShifting, setIsShifting] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has to go since we aren't adding widescreen for now
@@ -116,18 +138,41 @@ export function PlayerPart(props: PlayerPartProps) { | |||
<Player.Settings /> | |||
</> | |||
) : null} | |||
<Player.Fullscreen /> | |||
{/* Fullscreen on when not shifting */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, all this has to go
<Player.Fullscreen /> | ||
{/* Disable for iOS PWA */} | ||
{!isIOSPWA && ( | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just do
{!isIOSPWA && (<Player.Fullscreen />)}
)} | ||
{/* Add info for iOS PWA */} | ||
{isIOSPWA && ( | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
This aims to solve most of the problems with the iOS PWA.
Apple has restricted the use of many features for PWAs such as, not supporting Picture in Picture (PiP), breaking the functionality of the "standalone" display property, and always showing the home indicator on iPhone X and beyond.
Preview: https://pwa-improvements.envyflix.pages.dev/
Changes:
Disable PiP and Fullscreen for iOS PWA
Add info button for iOS PWA
Add Widescreen button
widescreen_sample-1.mov
Screen.Recording.2024-08-15.at.2.44.50.PM.mov
Fix top padding and safe areas for iOS PWA
BEFORE
AFTER
.pasithea
(we require this for the contributor role)